﻿using CSRedis;
using System;

namespace EFCoreToApi.Redis
{
    public class RedisContexts
    {
        CSRedisClient reids;
        public RedisContexts()
        {
            reids = new CSRedisClient("127.0.0.1:6379,ssl=false,writeBuffer=10240,prefix=test_");
        }

        public void Set(string Key,object Value, TimeSpan expiration)
        {
            // TimeSpan.FromSeconds(365 * 24 * 60 * 60)
            reids.Set(Key,Value,expiration);
        }

        public T Get<T>(string Key)
        {
            return reids.Get<T>(Key);
        }


    }
}
